package jsu.blogger.service.inter;

import jsu.blogger.pojo.BlogPostDetails;
import jsu.blogger.pojo.Post;
import jsu.blogger.pojo.PostWithTags;
import jsu.blogger.pojo.UserFolder;
import org.apache.ibatis.annotations.Insert;

import java.util.List;

public interface PostService {

    List<BlogPostDetails> getRelevantRecommendations(List<String> keywords,List<String>tagNames);
    UserFolder  newUserFavorites(long userId,UserFolder needUserFolder);
    int countPostsByFolderId(Long folderId);
    boolean existsByFolderIdAndPostId(Long folderId, Long postId);
    List<String> handlerPostFolders(Long userId, List<Long> folderIds, Long postId);
    List<UserFolder> getUserFolders(Long userId, int offset, int size);
    long createUserFolder(UserFolder userFolder);
    UserFolder  getDefaultUserFolder(Long userId);
    int handlePostLike(Long userId, Long postId, boolean isLike);
    int removeUserLikeOrDislike(Long userId, Long postId);


    Integer getUserPostLikeStatus(Long userId, Long postId);
    void deletePostTagsByPostId(Long postId);
    // 向 post_tags 表中插入数据
    void insertPostTag(Long postId, Long tagId);
    Long getTagIdByName(String tagName);
    void updatePostTags(Long postId, List<String> newTagNames);
    int insertPost(Post post);
    String getContentByPostId(Long postId);
    void updatePostContent(Long postId, String content);
    void insertBlogPostDetails(BlogPostDetails blogPostDetails);
    List<Long> getPostIdsWithTags(List<String> tagNames, Long offset, Long count) ;
    List<BlogPostDetails> getBlogPostDetails(Long userId, Long count,Long offset);
    BlogPostDetails getBlogPostDetailsById(Long postId);
    boolean postExists(Long postId,Long userId, Integer postType);
    Post getPostTitleAndContentById(Long postId,Long userId, Integer postType);
    List<String> getHotspotRange(long offset, long count);
    List<BlogPostDetails> searchUserAllBlogs(Long userId,Long count,Long offset);
    boolean deleteBlog(Long userId, Long postId);
    boolean  incrementReadCount(Long userId,Long postId);
}
